All Questions
Tagged with angularjs-directiveangular-directive
108 questions
1vote
0answers
32views
What would be your representation of a particule as an angular directive
I believe, the answers will provide nice and complete examples of angular's directives and also different points of view of actual understanding about particules. It applies to Angularjs and Angular ...
3votes
2answers
1kviews
Convert angularjs directive to angular 10
I want to use this code in my angular project: 'use strict'; /** * Floating text animation (random) */ angular.module('g1b.text-animation', []). directive('textAnimation', ['$document', '$interval',...
2votes
0answers
337views
Angular directive for numbers with decimals and key board copy paste support
<input type="text" formControlName="reg_retail" appTwoDigitDecimaNumber/> @Directive({ selector: '[appTwoDigitDecimaNumber]' }) export class TwoDigitDecimaNumberDirective { // Allow decimal ...
0votes
1answer
169views
how to reload directive data in angularjs?
I am using this directives https://embed.plnkr.co/plunk/XArO6p in my app. I want to refresh the data in this directive whenever the user revisits the the same page in my app. how can I do this?
1vote
0answers
550views
nativeElement.value is incorrect in angular 7 directive
I got incorrect value when I'm trying to select nativeElement.offsetwidth and nativeElement.offsetLeft. for both gotten value are the same and is different when I am consol.log full nativEelement. ...
1vote
1answer
34views
Update angular directive attribute value from parent controller
I have a Angular directive like this: angular.module("app", ["customers"]).run(); angular.module("app").controller("appController", function($scope) { $scope.customers = [{ name: "Microsoft" }]; ...
1vote
2answers
78views
Specify a directive as parameter (plugin) to another directive
I have a "host" directive, into which I wish to display a "plugin" directive one out of multiple possible "plugin" directives (say, plugin1, plugin2, plugin3 etc), and I want the container of the host ...
1vote
0answers
28views
AngularJs directive access in new Angular [duplicate]
I have an Angular v5 application running on the same page as an AngularJs v1.2.23 application. Is it possible to access & use a directive from the older AngularJs application in the new Angular ...
0votes
1answer
128views
TypeScript + AngularJS : Directive returning 0 on scope.$eval
I created a directive to compile some html then bind it to my element. Here is the directive export class BindCompileHtmlDirective implements ng.IDirective { restrict = 'A'; link = ...
1vote
1answer
627views
Query selector in nested AngularJS Directives
I'm using two directives in this HTML code: <div animations> <h2>Title</h2> <span class="animateBtn">Animate!</span> <info-section></info-section> &...
0votes
1answer
34views
Reinitialise directive on change of attribute
I have two directives, calling 2nd directive from 1st directive. This is my 1st directive var initializeWidget = function ($compile, $timeout, $rootScope) { return { restrict: 'EA',...
2votes
1answer
3kviews
How pass function inside directive to another directive
I have two separated directives. If some condition is evaluated to true I have to call second directive inside first. myDirectives.directive('first', function() { return { restrict: "E", ...
-2votes
1answer
60views
How to correctly call a controller function with in a directive?
I am using a directive in my html page under the impression of a controller. I need to call a controller function from that directive but I am unable to correctly do that. Every time there are some ...
0votes
1answer
174views
Second AngularJS directive not loading from html attribute
I have this directive which avoids an input to be marked as $pristine: (function () { 'use strict'; angular .module('blocks.noDirtyCheck', []) .directive('noDirtyCheck', function() { ...
0votes
1answer
2kviews
Access scope from link function in directive AngularJs?
I am trying to access the data in an ng-repeat from the link or controller function of the directive. My directive code looks like this. app.directive('ssLeftNavDirective', function($rootScope) { // ...